package com.wlr.study.leetcode;

import java.util.Arrays;

public class LeetCode344 {
    public void reverseString(char[] s) {
        int j = s.length - 1;
        for (int i = 0; i < j; i++) {
            char temp = s[i];
            s[i] = s[j];
            s[j] = temp;
            j--;
        }
    }

    public static void main(String[] args) {
        LeetCode344 leetCode344 = new LeetCode344();
        char[] chars = new char[]{'h','e','l','l','o'};
        leetCode344.reverseString(chars);
//        for (char aChar : chars) {
//            System.out.println(aChar);
//        }
        String test = "     hello world ";
        String[] s = test.split(" ");
        System.out.println("     ".trim().length());
        Arrays.stream(s).forEach(System.out::println);
    }
}
